import React from 'react'
import ReactDOM from 'react-dom'
//引入组件
import Login from './views/login'
import Home from './views/home'
// 引入路由组件
import { Router, Route, hashHistory, IndexRedirect } from 'react-router'

class App extends React.Component {
    render() {
        return (<>
            {this.props.children}
        </>)
    }
}

const router = (<Router history={hashHistory}>
    <Route path="/" component={App}>
        <IndexRedirect to="login" />
        <Route path="login" component={Login} />
        <Route path="home" component={Home} />
    </Route>
</Router>)

ReactDOM.render((
    router
), document.getElementById('root'));

